package org.glow.changgou.goods.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.glow.changgou.goods.pojo.Brand;

import java.util.List;

/**
 * @Author Glow
 * @Date 2022-09-20 12:59:47
 * @Description
 * @Version 1.0
 */
@Mapper
public interface BrandMapper extends BaseMapper<Brand> {
    /***
     * 查询分类对应的品牌集合
     */
    @Select("SELECT tb.* FROM tb_category_brand tcb,tb_brand tb WHERE tcb.category_id=#{categoryid} AND tb.id=tcb.brand_id")
    List<Brand> findByCategory(@Param("categoryid") Integer categoryid);
}
